import _ from "lodash";
import { Character } from "./type";

// 空白角色数据
export const defaultCharacter: Character = {
  id: 0,
  name: "",
  status: "",
  species: "",
  type: "",
  gender: "",
  origin: {
    name: "",
    url: "",
  },
  location: {
    name: "",
    url: "",
  },
  image: "",
  episode: [""],
  url: "",
};

// 获取首页数据时的渲染数据，渲染骨架屏
export const defaultSixCharacters: Character[] = "123456".split("").map((id) => {
  const newCharacter: Character = _.cloneDeep(defaultCharacter);
  newCharacter.id = parseInt(id) * 10000;
  return newCharacter;
});
